<!--
 * @Description: 查找书籍
 * @Author: tyq
 * @Date: 2021-02-25 21:08:19
 * @LastEditors: Wuyi
 * @LastEditTime: 2021-05-19 10:50:52
-->
<template>
    <div>
        <div>
            <el-input size="small" class="searchInput" placeholder="请输入要查询的书籍" suffix-icon="el-icon-search"
              @keydown.enter.native="searchBook"
              v-model="pos.name">
            </el-input>
            <el-button size="small" icon="el-icon-search" type="primary" @click="searchBook">查询</el-button>
        </div>
        <div class="searchMain">
            <el-table border stripe size="small" :data="book" style="width: 96%">
            <el-table-column prop="name" label="书名" width="150"></el-table-column>
            <el-table-column prop="author" label="作者" width="150"></el-table-column>
            <el-table-column prop="intro" label="介绍"></el-table-column>
            <el-table-column label="操作"></el-table-column>
            </el-table>
        </div>
    </div>
</template>
<script>
export default {
  name: 'searchBook',
  data () {
    return {
      pos: {
        name: ''
      },
      book: [],
      dialogVisible: false,
      updatePos: {
        name: ''
      },
      multipleSelection: []
    }
  },
  mounted () {
    this.initBook()
  },
  methods: {
    showEditView (index, data) {
      // 数据拷贝
      Object.assign(this.updatePos, data)
      // this.updatePos.createDate = ''  22 9:57
      this.dialogVisible = true
    }
  }
}
</script>
<style>
  .searchInput{
    width: 300px;
    margin-right: 8px;
  }
  .searchMain{
    margin-top: 20px;
  }
  .updataBookInfo{
    width: 200px;
    margin-left: 8px;
  }
</style>
